﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using SpringWaterDataAccess;

namespace sow
{
	/// <summary>
	/// Summary description for forums.
	/// </summary>
	public partial class forums : System.Web.UI.Page
	{
		private const int DisplayLinks = 5;

		// parameters to add links to the the header and footer
		int TotalTopics = 0;
		int TopicsPerPage = 0;
		string ForumID;
		string ForumName;
		string CategoryID;
		string CategoryName;
		string currPage;
		protected System.Web.UI.WebControls.HyperLink linkHomePage;
		protected System.Web.UI.WebControls.Label lblLevel1;
		protected System.Web.UI.WebControls.DataGrid DataGridForum;
		protected System.Web.UI.WebControls.HyperLink linkCategory;
		protected System.Web.UI.WebControls.Label lblLevel3;
		protected System.Web.UI.WebControls.HyperLink linkForum;
		protected System.Web.UI.WebControls.Label lblLevel2;
		protected System.Web.UI.WebControls.HyperLink linkForums;
		protected System.Web.UI.WebControls.Repeater Repeater1; 
		string startTopicID;

	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			// Retrieve the parameters
			ForumID = Request.QueryString["ForumID"];
			if (ForumID == null || ForumID == "") 
			{
				ForumID = "11";
            }

		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion

        protected void newArticleButton_Click(object sender, System.EventArgs e)
        {
            if (Request.Cookies["Email"] == null)
            {
                Response.Redirect("index.aspx?message=请您先注册/登录，再发表文章 !");
            }
            else if (CategoryID != null)
            {
                Response.Redirect("forumPostReply.aspx?categoryID=" + CategoryID
                    + "&categoryName=" + CategoryName
                    + "&ForumID=" + ForumID
                    + "&ForumName=" + ForumName);
            }
        }
    }
}
